package com.shop.service.impl;

import com.shop.entity.ShopUser;
import com.shop.mapper.ShopUserMapper;
import com.shop.service.ShopUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopUserServiceImpl implements ShopUserService {

    @Autowired
    private ShopUserMapper shopUserMapper;

    @Override
    public List<ShopUser> getShopUserList () {
        return shopUserMapper.selectAll();
    }

    @Override
    public ShopUser getShopUserByUsername(String username) {
        return shopUserMapper.selectByUsername(username);
    }

    @Override
    public int addShopUser(ShopUser record) {
        return shopUserMapper.insert(record);
    }

    @Override
    public int getLastUserId() {
        return shopUserMapper.selectLastUserId();
    }
}
